<?php

/* Web Statistics and Analytics Console (PHP)
 *  view_scripts.php
 *  Author: Trevor Bidyk
 *  Created: January 1, 2000
 *  Last modified: April 2, 2011
 *   (C) Us 2011
 *   Uses Simple PHP Framework, licensed under the FreeBSD license.
 *    View license in ./include/LICENSE.
 *   All rights reserved.
 */
require('includes/master.inc.php');
require('./functions.statistics.php');
$Auth->requireUser();

// We need to figure out what the user wants to display here.
if (isset($_GET['download'])) {
    if ($_GET['download'] == "js") {
        download_document('./subpages/view_scripts/script.js');
    } else if ($_GET['download'] == "zip") {
        download_document('./subpages/view_scripts/script.zip');
    } else if ($_GET['download'] == "tar") {
        download_document('./subpages/view_scripts/script.tar');
    } else {
        exit;
    }
} else {
    DisplayHeader('scripts', 'scripts');
    require_once('./subpages/view_scripts/home.php');
    DisplayFooter();
}
?>